



local function fn()
    local inst = CreateEntity()
    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddSoundEmitter()
    inst.entity:AddDynamicShadow()
    inst.entity:AddNetwork()

    -- MakeGiantCharacterPhysics(inst, 2000, .5)   --- 让NPC过重，没法被玩家推走

    -- MakeCharacterPhysics(inst, 50, .5)

    inst.DynamicShadow:SetSize(1.5, .75)

    TheSim:LoadPrefabs({ "quagmire_swampig" })

    inst.AnimState:SetBank("pigman")
    inst.AnimState:SetBuild("quagmire_swampig_build") 
    inst.AnimState:PlayAnimation("idle_loop", true)
    inst.AnimState:Hide("HAT")
    inst.AnimState:Hide("HAIR_HAT")
    inst.AnimState:Show("HAIR_NOHAT")
    inst.AnimState:Show("HAIR")
    inst.AnimState:HideSymbol("spawn_hat")




    if not TheWorld.ismastersim then
        return inst
    end

    inst:DoTaskInTime(0.1,function()
        if inst.Ready == true then
            return
        end

        if inst.__link_player == nil then
            inst:Remove()
            -- print("warning : npc.__link_player == nil , inst:Remove() ")
        else
            print("npc create and  link succeed")
        end
    end)


    ---------------------------------------------------------------------------------------------------------------
    return inst
end

return Prefab("monster_npc_pigman_arena_messenger", fn)
